package com.reader.cms.mapper.sys;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.reader.cms.entity.sys.SysUser;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author jiahaikun
 * @since 2018-06-27
 */
public interface SysUserMapper extends BaseMapper<SysUser> {
    SysUser getUserInfo(SysUser user);

    List<String> getUserRolesId(SysUser sysUser);

    List<String> getUserRolesName(SysUser sysUser);

    List<Map<String, String>> getUserPermissions(SysUser sysUser);

    List<Map<String, String>> getAllPermissions();

    List<Map<String, Object>> selectListPage(Pagination page,
                                             @Param("loginId") String loginId,
                                             @Param("name") String name,
                                             @Param("code")String code);

    void deleteUserRole(@Param("id") Integer id);

    void insertUserRole(@Param("id") Integer id, @Param("rolesId") List<String> rolesId);
}
